package com.uek.utils;

public class Result {
    private int code;
    private String message;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    //成功方法

    public static Result success(){
        Result rs=new Result();
        rs.setCode(ApiCode.SUCCESS.getCode());
        rs.setMessage(ApiCode.SUCCESS.getMsg());
        return rs;
    }
    public static Result success(int code,String message){
        Result rs=new Result();
        rs.setCode(code);
        rs.setMessage(message);
        return rs;
    }
    public static Result failure(){
        Result rs=new Result();
        rs.setCode(ApiCode.ERROR.getCode());
        rs.setMessage(ApiCode.ERROR.getMsg());
        return rs;
    }

    public static Result failure(int code,String message){
        Result rs=new Result();
        rs.setCode(code);
        rs.setMessage(message);
        return rs;
    }




}
